<form class="layui-form layui-card">
    <div class="layui-card-body padding-left-40">
        <div class="layui-form-item text-center padding-bottom-20">
            <img class="block" alt="" id="ShowWxQrcImage" style="width:320px;height:320px;" src="{$vo.wxqrc}">
            <div class="color-green font-s16">{$vo.message|default='请使用微信扫码登录'}</div>
        </div>
    </div>

    <script>
        $(function () {
            doCheckLogin();

            function doCheckLogin() {
                $.form.load('{:url("check")}', {}, 'post', function (ret) {
                    if (ret.code > 0) try {
                        if (ret.data.code === 'wxqrc') {
                            ret.qrc = document.getElementById('ShowWxQrcImage');
                            ret.qrc.src = ret.data.wxqrc || 'javascript:void(0)';
                            return setTimeout(doCheckLogin, 1500) && false;
                        } else {
                            $.msg.closeThisModal(document.getElementById('ShowWxQrcImage'));
                            return $.form.reload() && false;
                        }
                    } catch (e) {
                        return false;
                    }
                }, false);
            }
        });
    </script>
</form>